import {adminUrl,teacherUrl} from "@/utils/baseUrl.js"
import request from '@/utils/request'


// 创建考勤管理
export function createAttendanceManagement(data) {
  return request({
    url: adminUrl + '/study/attendance-management/create',
    method: 'post',
    data: data
  })
}

// 更新考勤管理
export function updateAttendanceManagement(data) {
  return request({
    url: adminUrl + '/study/attendance-management/update',
    method: 'put',
    data: data
  })
}

// 删除考勤管理
export function deleteAttendanceManagement(id) {
  return request({
    url: adminUrl + '/study/attendance-management/delete?id=' + id,
    method: 'delete'
  })
}

// 获得考勤管理
export function getAttendanceManagement(id) {
  return request({
    url: teacherUrl + '/study/teacher/leave/get/info?id=' + id,
    method: 'get'
  })
}

// 获得考勤管理分页
export function getAttendanceManagementPage(query) {
  return request({
    url: teacherUrl + '/study/teacher/leave/check/page',
    method: 'get',
    params: query
  })
}

// 导出考勤管理 Excel
export function exportAttendanceManagementExcel(query) {
  return request({
    url: adminUrl + '/study/attendance-management/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
//  审批考勤
export function checkAttendanceManagement(data) {
  return request({
    url: teacherUrl + '/study/teacher/leave/check',
    method: 'PUT',
    data: data
  })
}

